import request from '@/config/axios'

// 检验类型-检验项目关联 VO
export interface InspectionTypeItemVO {
  id: number // 主键id
  typeId: number // 检验类型主键id
  itemId: number // 检验项目主键id
}

// 检验类型-检验项目关联 API
export const InspectionTypeItemApi = {
  // 查询检验类型-检验项目关联分页
  getInspectionTypeItemPage: async (params: any) => {
    return await request.get({ url: `/opticore/inspection-type-item/page`, params })
  },

  // 查询检验类型-检验项目关联详情
  getInspectionTypeItem: async (id: number) => {
    return await request.get({ url: `/opticore/inspection-type-item/get?id=` + id })
  },

  // 新增检验类型-检验项目关联
  createInspectionTypeItem: async (data: InspectionTypeItemVO) => {
    return await request.post({ url: `/opticore/inspection-type-item/create`, data })
  },

  // 修改检验类型-检验项目关联
  updateInspectionTypeItem: async (data: InspectionTypeItemVO) => {
    return await request.put({ url: `/opticore/inspection-type-item/update`, data })
  },

  // 删除检验类型-检验项目关联
  deleteInspectionTypeItem: async (id: number) => {
    return await request.delete({ url: `/opticore/inspection-type-item/delete?id=` + id })
  },

  // 导出检验类型-检验项目关联 Excel
  exportInspectionTypeItem: async (params) => {
    return await request.download({ url: `/opticore/inspection-type-item/export-excel`, params })
  },
}